/**
 * Created by zkt on 2017/1/17.
 */
var ejs = require('ejs');
var menuModel = require('../model/Menu');
var util = require("util");
// 格式化输出日期
ejs.filters.dateFormat = function (time) {
    return new Date(time).toISOString().replace(/T/, ' ').replace(/\..+/, '');
};
module.exports = function(app){
    app.get('/index', function (req, res) {
        var user = req.session.user;
        var menuList = req.session.menuList;
        if(util.isNullOrUndefined(user) || util.isNullOrUndefined(user.username)){
            res.redirect('/');
        }else{
            res.render('index');
        }
    });
};

